import axios from 'axios'
import './index'
const eventsBaseUrl = import.meta.env.VITE_BASE_URL
function Post({
  url,
  method = 'post',
  user_id,
  event_type,
  event_describe,
  road_section_id,
  event_driver,
  event_car_number
}) {
  return axios({
    url: eventsBaseUrl + url,
    method,
    data: {
      user_id,
      event_type,
      event_describe,
      road_section_id,
      event_driver,
      event_car_number
    }
  })
}

const addeventsPost = (
  user_id,
  event_type,
  event_describe,
  road_section_id,
  event_driver,
  event_car_number
) => {
  return Post({
    url: '/events',
    user_id,
    event_type,
    event_describe,
    road_section_id,
    event_driver,
    event_car_number
  })
}

// 导出公告请求模块
export { addeventsPost }
